home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / uucp / aminetutils.lzh / AmiNet / AmiNetUpdate.rexx < prev   
OS/2 REXX Batch file  |  1995-10-22  |  2KB  |  71 lines

  1. /* This script will attempt to get the most recent AmiNet index file
  2. ** then process it automaticaly.
  3. **
  4. ** You can safely call this program once each night. It there is nothing
  5. ** for it to do, it will quickly exit. This insures your AmiNet filesare
  6. ** as up to date as posible. 
  7. **
  8. **
  9. ** SENDMAIL, UNCOMPRESS, and UUBREAK must be in the normal search path.
  10. **
  11. **
  12. ** The assumption is made that you have placed all your files in the
  13. ** directory DOORS:AMINET/ as originaly suggested. If you have moved them,
  14. ** please change the variables below as needed.
  15. **
  16. **
  17. ** If your system can't receive 1meg UUENCODED messages in a single block,
  18. ** you will need to update the index manualy. This program won't work on
  19. ** broken up files.
  20. */
  21.  
  22. options results
  23.  
  24. WorkDir = 'Doors:AmiNet/'
  25. uumail  = 'uumail:'
  26. fakename= 'AmiNet'
  27.  
  28.  
  29.  
  30. /*--------------------< CHANGE NOTHING BEYOND THIS POINT >----------------*/
  31.  
  32.  
  33. updatefile=WorkDir'Update.txt'
  34. AmiNetBreak=WorkDir'AmiNetBreak'
  35. fakeuser=uumail||fakename
  36. tempdir=uumail'AmiNet-TempDir'
  37. update='??/??/??'
  38.  
  39. if exists(fakeuser) then do
  40.     shell command 'makedir <>NIL: 'tempdir
  41.     pragma('D',tempdir)
  42.     shell command 'uubreak 'fakeuser
  43.     shell command 'uncompress 'tempdir'/INDEX.Z'
  44.     shell command AmiNetBreak' 'WorkDir' 'TempDir'/INDEX'
  45.     pragma('D',WorkDir)
  46.     shell command 'Delete <>NIL: 'tempdir' all'
  47.     shell command 'Delete <>NIL: 'fakeuser
  48. end
  49. if open(infile,updatefile,'r') then do
  50.     update=strip(upper(readln(infile)))
  51.     close(infile)
  52. end
  53. dt=upper(word(date(),2)' 'right(date(),2))
  54. dt2=word(date(),1)+2
  55. if dt~=update & (dt2/3=trunc(dt2/3)) then do
  56.     if open(outfile,'t:AmiNetRequest','w') then do
  57.         writeln(outfile,'To: bitftp@pucc.princeton.edu')
  58.         writeln(outfile,'Subject: FTP Request')
  59.         writeln(outfile,'')
  60.         writeln(outfile,"ftp ftp.wustl.edu uuencoded")
  61.         writeln(outfile,'user anonymous')
  62.         writeln(outfile,'chunksize 0')
  63.         writeln(outfile,'cd /pub/aminet')
  64.         writeln(outfile,'get INDEX.Z')
  65.         close(outfile)
  66.         shell command 'sendmail <t:AmiNetRequest -f 'fakename
  67.         shell command 'delete <>NIL: t:AmiNetRequest'
  68.     end
  69. end
  70.  
  71.